<%@ include file="/common/taglibs.jsp" %>

<head>
    <title><fmt:message key="mailEdit.title"/></title>
    <meta name="menu" content="AdminMenu"/>
    <script type="text/javascript" src="<c:url value='/scripts/adapters/ckeditor.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/scripts/adapters/jquery.js'/>"></script>
</head>
<body id="info">

<div>
    <h2><fmt:message key="mailEdit.heading"/></h2>
	<s:form name="editMailForm" action="saveMail" method="post" validate="true" cssClass="well form-horizontal" autocomplete="off">
		
		<h4><fmt:message key="template.${ template.name }"/> (${ template.name }):</h4>
		<s:hidden key="template.id" />
		<s:hidden key="template.name" />
		<hr>
		<h5><fmt:message key="lang.es"/></h5>
		<s:textfield key="template.subject_es" />
		 <s:textarea key="template.body_es">
		</s:textarea>


		<hr>
		<h5><fmt:message key="lang.en"/></h5>
		<s:textfield key="template.subject_en" />
		<s:textarea key="template.body_en">
		</s:textarea>
		
		<div id="actions" class="form-actions">
            <s:submit type="button" cssClass="btn" method="save" key="button.save" theme="simple">
                <fmt:message key="button.save"/>
            </s:submit>
            <div class="btn" onclick="window.history.back();">
                <i class="icon-remove"></i>
                <fmt:message key="button.cancel"/>
            </div>
        </div>
	</s:form>
 
	<script type="text/javascript">
	// Toolbar configuration generated automatically by the editor based on config.toolbarGroups.

	
		CKEDITOR.replace( 'saveMail_template_body_es', {
			toolbar: [
						{ name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] },
						{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ], items: [ 'Scayt' ] },
						{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] },
						{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote' ] },
						{ name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] },
						'/',
						{ name: 'insert', items: [ 'Image', 'Table', 'HorizontalRule', 'SpecialChar' ] },
						{ name: 'styles', items: [ 'Styles', 'Format' ] },
						{ name: 'tools', items: [ 'Maximize' ] },
						{ name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ 'Source' ] },
						{ name: 'font', items: [ 'Font', 'FontSize' ] },
					]
		} );

	
		CKEDITOR.replace( 'saveMail_template_body_en', {
			toolbar: [
				{ name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] },
				{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ], items: [ 'Scayt' ] },
				{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] },
				{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote' ] },
				{ name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] },
				'/',
				{ name: 'insert', items: [ 'Image', 'Table', 'HorizontalRule', 'SpecialChar' ] },
				{ name: 'styles', items: [ 'Styles', 'Format' ] },
				{ name: 'tools', items: [ 'Maximize' ] },
				{ name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ 'Source' ] },
				{ name: 'font', items: [ 'Font', 'FontSize' ] },
			]
			
		});

   	</script>		
</div>
</body>